-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pending transactions #1954
Pending transactions #1954
Conversation
Deployed to Cloudflare Pages
|
1b5b7d4
to
5f93feb
Compare
b4cfe60
to
a3a0cb4
Compare
5103383
to
cf5d71f
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1954 +/- ##
==========================================
- Coverage 79.82% 79.80% -0.03%
==========================================
Files 212 212
Lines 5467 5555 +88
Branches 1025 1059 +34
==========================================
+ Hits 4364 4433 +69
- Misses 1103 1122 +19
Flags with carried forward coverage won't be shown. Click here to find out more.
|
cf5d71f
to
cea904c
Compare
@@ -50,7 +53,16 @@ export function getOasisscanAPIs(url: string | 'https://api.oasisscan.com/mainne | |||
return data | |||
} | |||
|
|||
async function getTransactionsList(params: { accountId: string; limit: number }): Promise<Transaction[]> { | |||
async function getTransaction({ hash }: { hash: string }) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: Add cache mechanism, as transaction won't ever change once we already fetch it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
52f8586
to
62c1711
Compare
62c1711
to
daf6e15
Compare
2a37deb
to
0e77efa
Compare
src/app/pages/AccountPage/Features/TransactionHistory/__tests__/index.test.tsx
Outdated
Show resolved
Hide resolved
src/app/pages/AccountPage/Features/TransactionHistory/__tests__/index.test.tsx
Outdated
Show resolved
Hide resolved
7273e31
to
21b1d9b
Compare
- needs better UX in case it updates, like flash or some animation
21b1d9b
to
09083aa
Compare
yield* put(accountActions.transactionsLoaded(transactions)) | ||
|
||
const detailedTransactions = yield* call(() => | ||
Promise.allSettled(transactions.map(({ hash }) => getTransaction({ hash }))), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This tries to incorrectly fetch paratime transactions too. See requests in:
https://wallet.dev.oasis.io/account/oasis1qry5d5zxs58w9deu5ara5zaamhkzqtg99s00ls90
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. Is there any better way to determine if the tx is a runtime tx -> #1999?
Description
This PR addresses #1942. So the initial proposition was that we should decrease the time to fetch transactions. Which in my opinion does not solve the core issue, of not showing pending transaction. So this PR introduces a list of pending transactions, which should mitigate original issue in some way.
I wanted to introduce polling for each of the transactions, that would refresh the state of each pending transaction on each new block. But that introduces a state, where balance could be out of sync with the actual transaction history - also it would need a synchronous clock - which is also a hustle to implement, as the right approach IMO would be to refresh the balance/pending txs on each new block.
oasis.client.NodeInternal
functionconsensusWatchBlocks
, would be ideal for that case, but does not seems to work, either there is an issue with TS client implementation or the grpc node does not support the method.Resources